cmake_minimum_required(VERSION 3.14)
project(eds_gat)

set(CMAKE_CXX_STANDARD 11)

#if (${EDS_COMMON_PATH} STREQUAL "")
#    set(EDS_COMMON_PATH ../eds_debug_t)
#endif ()

#option(EDS_COMMON_PATH "set eds_common lib path." ../eds_dev)
if (IS_DIRECTORY ${EDS_COMMON_PATH})
else ()
    #message(FATAL_ERROR "invalid EDS_COMMON_PATH ${EDS_COMMON_PATH} is not dir.")
endif ()


include_directories(.
        ../tidp/include
        API/C/edsapi/include
        /usr/local/include
        ../eds_common/include)


link_directories(../eds_common/lib
        /usr/local/lib
        API/C/lib)
#add_subdirectory(../eds_common eds_common.out)
#include_directories(../eds_common/include)

aux_source_directory(API/C/edsapi/src EDS_SRC)
message(STATUS ${EDS_SRC})
find_package(Poco CONFIG REQUIRED COMPONENTS Foundation Util Net XML Zip JSON)
find_package(RdKafka CONFIG REQUIRED)

add_executable(eds_gat
        EdsPointThread.cpp
        HttpServer.cpp
        KafkaServer.cpp
        main.cpp
        PointData.cpp
        ${EDS_SRC}
        )

#target_link_directories(eds_gat ../eds_debug/lib)
#add_subdirectory(../eds_common)
target_link_libraries(eds_gat
        liveeds2 archeds2 loggereds2 objeds2 sqlite_drveds2
        eds_common
        Poco::Foundation Poco::Util Poco::Net Poco::XML Poco::Zip
        RdKafka::rdkafka RdKafka::rdkafka++
        tidp
        pthread)


install(TARGETS eds_gat DESTINATION bin/)

#CPack
include(InstallRequiredSystemLibraries)
include(CPack)